function y = minDistSearch(pt,model)

        min_d = inf;
        
        for i=1:size(model,3),
            
           dist = DistP2Segment(pt,model(:,:,i));
           
           if dist < min_d, min_d = dist; end
        end
        
        y = min_d;
end